<?php


namespace App\Models;

use Illuminate\Database\Eloquent\Builder;

trait Scope {
    public function scopeSizeBefore(Builder $query, $data): Builder {
        return $query->where('size', '<=', $data);
    }

    public function scopeSizeAfter(Builder $query, $data): Builder {
        return $query->where('size', '>=', $data);
    }

    public function scopeSizeBetween(Builder $query, $start, $end): Builder {
        return $query->whereBetween('size', [$start, $end]);
    }
}
